onmessage = function(event) {
	var index = event.data;
	console.log('worker '+index);
	var i=0;
	var data = {workerIndex:index,i:i};
	function timedCount()
	{
		i=i+1;
		data.i = i;
		
		postMessage(JSON.stringify(data));
		setTimeout(function() {timedCount()},500);
	}

	timedCount();
}
